package com.linwen.javase.desgin_pattern.BigTalkDesignPattenJAVACode._03装饰模式._4装饰器基本代码;

/**
 * @ClassName Test
 * @Description TODO
 * @Author zero
 * @DATE 2023/7/10 10:21 PM
 * @Version 1.0
 */
public class Test {
    public static void main(String[] args) {
        ConcreteComponent c = new ConcreteComponent();
        ConcreteDecoratorA d1 = new ConcreteDecoratorA();
        ConcreteDecoratorB d2 = new ConcreteDecoratorB();

        d1.SetComponent(c);	//首先用d1来包装c
        d2.SetComponent(d1);//再用有来包装d1
        d2.Operation();   	//最终执行d2的Operation()
    }
}
